#include<stdio.h>
#include<stdlib.h>
char* Strcat(char* str1, char* str2)
{
	int count1 = 0, count2 = 0;
	char *p1=str1;
	while (str1&&*p1++!='\0')
	{
		count1++;
	}
	char *p2=str2;
	while (str2&&*p2++!='\0')
	{
		count2++;
	}
	char *s=(char*)malloc(sizeof(char)*(count1+count2)+1);
	char *t=s;
	while(str1&&*str1!='\0')
	{
		*s++=*str1++;
	}
	while(str2&&*str2!='\0')
	{
		*s++=*str2++;
	}
	*s='\0';
	return t;	
}
int main()
{
	
	printf("%s\n",Strcat("abc","def"));
	printf("%s\n",Strcat("abc",""));
	printf("%s\n",Strcat("abc",NULL));
	printf("%s\n",Strcat(NULL,"abc"));
	printf("%s\n",Strcat(NULL,NULL));
	return 0;
}


